<?php

require_once('include.php');

$id = intval($argv[1]);

$graph = new DBGraph($id);
	
$start = microtime(true);
$lulco = new Lulco();
$graph = $lulco->coloring($graph);
$end = microtime(true);

if ($graph) {
	$params = array(
		'algorithm' => 3,
		'graph' => $graph->getDbId(),
		'found_chromatic_number' => $graph->getColorsCount(),
		'duration' => $end - $start,
		'coloring' => $graph->getSerializedColors(),
	);
	
	if ($graph->check()) {
		$params['good'] = 1;
	}
	
	$GLOBALS['db']->insert('chromatic_number', $params);
}

?>